package vcp.enums;

import vcp.enums.utility.EnumReverser;
import vcp.enums.utility.EnumReverser.IEnumReverser;

/**
 * 
 * @author VCP team
 *         <p>
 *         report types enum class
 *         </p>
 */
public enum ReportType implements IEnumReverser
{
	COMPLAINTS ( "Complaints" ),
	NON_WORKING_LOT ( "Non working lots" ),
	SUBSCRIPTION ( "Subscriptions" ),
	WORKER_RECORDS ( "Worker Records" ),
	QUARTERS ( "Quarter reports" ),
	ACTIVITY ( "Activity" ),
	PERFORMANCE ( "Performance" ),
	EXCEPTIONS ( "Exceptions" );

	private String type;

	/** constructor **/
	private ReportType ( String type )
	{
		this.type = type;
	}

	@Override
	public String toString ()
	{
		return this.type;
	}

	/** convert to relevant type by key **/
	public static ReportType convert ( String key )
	{
		return EnumReverser.convert(ReportType.class, key);
	}

	/**
	 * 
	 * @return relevant reports for site manager
	 */
	public static ReportType[] siteManagerReports ()
	{
		return new ReportType[]
			{ COMPLAINTS
					, NON_WORKING_LOT
					, SUBSCRIPTION };
	}

	public static ReportType[] ceoStatisticalReports ()
	{
		return new ReportType[]
			{ ACTIVITY,
					PERFORMANCE,
					EXCEPTIONS };
	}

	/**
	 * 
	 * @author VCP team
	 *         <p>
	 *         reports types for CEO
	 *         </p>
	 */
	public enum ReportReadOnlyType
	{
		SUBSCRIPTION ( "Subscriptions" ),
		WORKER_RECORDS ( "Worker Records" ),
		QUARTER_REPORTS ( "Reports" );

		private String type;

		private ReportReadOnlyType ( String type )
		{
			this.type = type;
		}

		@Override
		public String toString ()
		{
			return this.type;
		}
	}
}
